package com.bp.hearthealth.pulse.lnapps.ads.topon.open_ad.observer

object TopOnSplashFinishObservable {

    private val observableList = mutableListOf<TopOnSplashFinishObserver>()

    fun registerSplash(topOnSplashFinishObserver: TopOnSplashFinishObserver) {
        if (!observableList.contains(topOnSplashFinishObserver)) {
            observableList.add(topOnSplashFinishObserver)
        }
    }

    fun unRegisterSplash(topOnSplashFinishObserver: TopOnSplashFinishObserver) {
        if (observableList.contains(topOnSplashFinishObserver)) {
            observableList.remove(topOnSplashFinishObserver)
        }
    }

    fun notifySplash(splashType: SplashType) {
        if (observableList.isNotEmpty()) {
            observableList.forEach { mtgSplashFinishObserver ->
                mtgSplashFinishObserver.topOnSplashFinish(splashType)
            }
        }
    }
}
enum class SplashType {
    TYPE_SPLASH_FINISH,
    TYPE_LAUNCH_FINISH
}